package Demo;

import java.util.ArrayList;

//用户类
public class User {
    private String username;//用户名
    private String password;//密码
    private String nickname;//昵称
    private String signname;//个性签名
    private String birthday;//生日
    private  ArrayList<Pets>list1 = new ArrayList<>();//宠物背包

    public User() {
    }



    public void setList1(ArrayList<Pets> list1) {
        this.list1 = list1;
    }

    public User(String username, String password) {
        this.username = username;
        this.password = password;
        this.nickname = username;//默认昵称为用户名
        this.signname ="";//默认个性签名为空
        this.birthday ="2000年01月01日";//默认出生日期
    }



    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSignname() {
        return signname;
    }

    public void setSignname(String signname) {
        this.signname = signname;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public ArrayList<Pets> getPets() {
        System.out.print("用户的宠物背包：【");
        for (int i = 0; i < list1.size(); i++) {
            System.out.print("第"+(i+1)+"只宠物："+"\t"+"姓名为"+list1.get(i).getName()+"\t"+"宠物血量为"+list1.get(i).getHealth()
                    +"\t"+"宠物攻击力为"+list1.get(i).getAttack()+"\t"+"宠物防御力为"+list1.get(i).getDefense());
        }
        System.out.print("】");
        return list1;
    }


}